.class Lcom/waiqin365/lightapp/im/activity/as;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/view/View$OnKeyListener;


# instance fields
.field final synthetic a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;


# direct methods
.method constructor <init>(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/im/activity/as;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onKey(Landroid/view/View;ILandroid/view/KeyEvent;)Z
    .locals 5

    const/4 v4, 0x0

    invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I

    move-result v0

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    const/16 v0, 0x43

    if-ne p2, v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/activity/as;->a:Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;

    invoke-static {v0}, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->u(Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;)Z

    move-result v0

    if-eqz v0, :cond_0

    sget-object v0, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->b:Lcom/waiqin365/lightapp/im/widget/PasteEditText;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/widget/PasteEditText;->getText()Landroid/text/Editable;

    move-result-object v0

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    sget-object v0, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->b:Lcom/waiqin365/lightapp/im/widget/PasteEditText;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/im/widget/PasteEditText;->getSelectionStart()I

    move-result v0

    if-lez v0, :cond_0

    sget-object v1, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->b:Lcom/waiqin365/lightapp/im/widget/PasteEditText;

    invoke-virtual {v1}, Lcom/waiqin365/lightapp/im/widget/PasteEditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v4, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    const-string/jumbo v2, "@"

    invoke-virtual {v1, v2}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v2

    const/4 v3, -0x1

    if-eq v2, v3, :cond_0

    invoke-virtual {v1, v2, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v3

    add-int/lit8 v3, v3, -0x1

    invoke-virtual {v1, v4, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    const-string/jumbo v3, " "

    invoke-virtual {v1, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    sget-object v1, Lcom/waiqin365/lightapp/im/activity/CustomServiceChatActivity;->b:Lcom/waiqin365/lightapp/im/widget/PasteEditText;

    invoke-virtual {v1}, Lcom/waiqin365/lightapp/im/widget/PasteEditText;->getEditableText()Landroid/text/Editable;

    move-result-object v1

    invoke-interface {v1, v2, v0}, Landroid/text/Editable;->delete(II)Landroid/text/Editable;

    :cond_0
    return v4
.end method
